package com.panghl.pojo;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.ToString;

import java.beans.Transient;
import java.util.Date;
import java.util.List;

/**
 * 员工
 */
@Data
@TableName("tb_user")
@ToString
public class User {
    @Excel(name = "编号",orderNum = "0",width = 5)
    private Long id;         //主键

    @Excel(name = "员工名",orderNum = "1",width = 15,isImportField = "true")
    private String userName; //员工名
    @Excel(name = "手机号",orderNum = "2",width = 15,isImportField = "true")
    private String phone;    //手机号
    @Excel(name = "省份名",orderNum = "3",width = 15,isImportField = "true")
    private String province; //省份名
    @Excel(name = "城市名",orderNum = "4",width = 15,isImportField = "true")
    private String city;     //城市名
    @Excel(name = "城市名",orderNum = "5",width = 10,type = 10,isImportField = "true")
    private Integer salary;   // 工资
    @JsonFormat(pattern="yyyy-MM-dd")
    @Excel(name = "入职日期",orderNum = "6",width = 15,format = "yyyy-MM-dd",isImportField = "true")
    private Date hireDate; // 入职日期

    @JsonIgnore //转json时不考虑这个字段
    @TableField(exist = false) //这个字段不需要和表对应
    private String hireDateStr; // 入职日期

    @Excel(name = "部门id",orderNum = "7",width = 15,isImportField = "true")
    private String deptId;   //部门id
    @Excel(name = "出生日期",orderNum = "8",width = 15,format = "yyyy-MM-dd",isImportField = "true")
    private Date birthday; //出生日期
    @Excel(name = "一寸照片",orderNum = "10",width = 15,type = 2,savePath = "D:\\JavaStudy\\Project\\workpase\\report_management\\src\\main\\resources\\static\\user_photos")
    private String photo;    //一寸照片
    @Excel(name = "现在居住地址",orderNum = "9",width = 15,isImportField = "true")
    private String address;  //现在居住地址

    @TableField(exist = false)
    private List<Resource> resourceList; //办公用品

}
